package com.xuecheng.teaching.convert;


import com.xuecheng.api.teaching.model.dto.WorkRecordDTO;
import com.xuecheng.teaching.entity.WorkRecord;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface WorkRecordConvert {

    WorkRecordConvert INSTANCE = Mappers.getMapper(WorkRecordConvert.class);

    @Mapping(source = "id", target = "workRecordId")
    WorkRecordDTO entity2dto(WorkRecord entity);


    @Mapping(source = "workRecordId", target = "id")
    WorkRecord dto2entity(WorkRecordDTO dto);

    List<WorkRecordDTO> entitys2dtos(List<WorkRecord> entitys);

}
